import React, { memo } from 'react'
import PropTypes from 'prop-types'
import { SectionWrapper } from './style'

const SectionHeader = memo(function SectionHeader(props) {
  const { title, subtitle } = props

  return (
    <SectionWrapper>
      <h2 className="title">{title}</h2>
      {subtitle && <div className="subtitle">{subtitle}</div>}
    </SectionWrapper>
  )
})

SectionHeader.propTypes = {
  title: PropTypes.string,
  subtitle: PropTypes.string,
}

/* SectionHeader.defaultProps = {
  subtitile: '默认子标题',
} */

export default SectionHeader
